Diagrams

After everything was working alright I shelved the whole thing for a couple of weeks. Then I started working on the diagram printing mechanism.
This is rather straightforward and the entire printing code is included in the file diagrams.c. It contains the functions

AppendRasterFile(char *rasterfile):
appends the raster data contained in the file rasterfile (and nothing more) to the current printout. Alas, the Acorn LJ printer drivers don't support PDriver_Select/InsertIllustration. I'm including everything from the first ESC,*,r,… (raster graphics on, inclusive) to the last 0x0c (page feed, exclusive). This system works fine with all the LJ printer drivers included in Printers 1.52.

abort_printing(…):
In case anything went wrong during printing...

diagram(char *diagname, diagtrafo *dt):
the actual printing code. It prints out the diagram with the filename diagname, using the transformations specified in dt, which include scaling in both directions as well as cropping from all sides.

One word concerning cropping in diagram: you could interpret cropping as simply removing parts of the diagram but keeping the position unchanged. I thought this was the way it was supposed to be at first but DVIview simply moves the entire image so I added support for this mode as well; define CROP_MODE_DVIVIEW and you'll get cropping like in DVIview  otherwise the other variety is selected. The binary included in this release was compiled with CROP_MODE_DVIVIEW defined.